package webService;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * start the website
 * @author ran,barak
 *
 */
public class StartWebService implements Runnable{
	/**
	 * Default serialVersionUID
	 */
	private static final long serialVersionUID = 1L;
	private Server server;
	
	/**
	 * start the website
	 */
	public void run(){
		// define the 80 port
		server = new Server(80);
		// bind the WebContent folder
		WebAppContext bb = new WebAppContext();
        bb.setServer(server);
        bb.setContextPath("/");
        bb.setWar("WebContent");
        server.addHandler(bb);
		try {
			server.start();
			server.join();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
